package com.example.springbootproject.controller;

import com.example.springbootproject.pojo.Customer;
import com.example.springbootproject.service.CustomerService;
import com.example.springbootproject.service.LoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;
import java.util.List;

/**
 * @author: 王博
 * @create: 2024-05-09 15:42
 */
@RestController
@Slf4j
public class CustomerController {

    @Autowired
    private CustomerService customerService;


    @GetMapping("/customer")
    protected void loginMain() {
        for (int i = 0; i < 100; i++) {
            Customer customer = new Customer();
            customer.setEventDate(LocalDate.now());
            customer.setName("王武"+i);
            customer.setAge(i);
            customerService.save(customer);
            log.info("保存成功:{}",customer);
        }
    }
}
